using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PanelList : PanelBase
{
    public UIList m_list;
    
    void Start()
    {
        Init();
        ClosePanel();
    }

    protected override void Init()
    {
        base.Init();
        m_PanelType = EPanelType.Module;
        m_list.Init();
        var list_item = m_list.GetListItems();
        for (int i = 0; i < list_item.Length; i++)
        {
            UIListItem tmpItem = list_item[i];
            tmpItem.m_btn.onClick.AddListener(delegate { OnClickEvent(tmpItem); });
        }
    }

    private void OnClickEvent(UIListItem pItem)
    {
        Debug.Log($"被点击的按钮编号是{pItem.m_item_index}");
    }
    
}
